package cn.com.yto56.cainiao.exponent.dto;

import cn.com.yto56.basic.framework.model.rest.BaseResponse;
import lombok.Getter;
import lombok.Setter;

@Setter
@Getter
public class RestResponse<T> implements BaseResponse {

    private Boolean state;
    private T data;
    private String message;

    public RestResponse() {
        state = false;
    }

    public RestResponse<T> success(T d) {
        state = true;
        data = d;
        return this;
    }

    public RestResponse<T> failure(String m) {
        state = false;
        message = m;
        return this;
    }
}
